package edu.hawaii.halealohacli.jcev.command;

import static org.junit.Assert.assertFalse;
//import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
//import javax.xml.datatype.XMLGregorianCalendar;
import org.junit.Test;
import org.wattdepot.client.WattDepotClient;

/**
 * Tests the functionality of SetBaseline and it's methods.
 * 
 * @author Kamana
 *
 */
public class TestSetBaseline {
  
  WattDepotClient client = new WattDepotClient("http://server.wattdepot.org:8190/wattdepot/");
  
  SetBaseline sb = new SetBaseline();
  
  /**
   * Tests setLocation method.
   * 
   */
  @Test
  @SuppressWarnings("unused")
  public void testSetLocation() {
    String validName = "Lehua";
    String validName2 = "Mokihana-A";
    String invalidName = "Limbo";
      try {
        String testStr = sb.setLocation(client, validName);
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      assertTrue("The name should be valid.",sb.testArgs);
      try {
        String testStr2 = sb.setLocation(client, validName2);
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      assertTrue("The name should be valid.",sb.testArgs);
      try {
        String testStr3 = sb.setLocation(client, invalidName);
        fail("the name is not valid!");
      }
      catch (Exception e) {
        System.out.println("aha!");
      }
      assertFalse("The name was invalid.",sb.testArgs);
  }
  
}
